<%@ Page Language="C#" MasterPageFile="~/MasterPageMcSigAdmin.master" AutoEventWireup="true"
    CodeFile="RecursosIva.aspx.cs" Inherits="RecursosIva" Title="Untitled Page" %>
<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Register Assembly="eWorld.UI" Namespace="eWorld.UI" TagPrefix="ew" %>
<%@ Register Assembly="Anthem" Namespace="Anthem" TagPrefix="anthem" %>
<%@ Register assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView.Export" tagprefix="dxwgv" %>
<%@ Register Assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
<%@ Register Assembly="UsrControls" Namespace="UsrControls" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    <script language="javascript" type="text/javascript">
function OnCountryChanged(cmbCountry) 
{
    alert(cmbCountry.GetValue());
    grid.GetEditor("CTT_ID").PerformCallback(cmbCountry.GetValue());
    //grid.GetEditor("FAE_VALOR_CDP").PerformCallback(cmbCountry.GetValue());
    
}

	function actualizarTotales()
	{
	  Anthem_InvokePageMethod(
            'CargarTotales',
            [],
            function(result) {}
        );	    
        
	}
	
	function publisch_PreCallBack() 
    {
        return confirm ('Esta seguro de enviar el proyecto seleccionado a revision por parte del Ministerio de Cultura?')
        return(false);
    } 
    
    function publisch_PostCallBack() 
    {
        return alert('Su proyecto se envio al Ministerio de Cultura para revision')
        
    }
	
    </script>
    <h1 class="iva">Proyecto</h1>
<anthem:ValidationSummary ID="ValidationSummary1" runat="server" AutoUpdateAfterCallBack="True" />
<anthem:Label ID="lblMensaje" runat="server" AutoUpdateAfterCallBack="True" UpdateAfterCallBack="True"></anthem:Label>
    <cc1:msgBox ID="MsgBox1" runat="server" />
<p class="bt-space10">
                <asp:Label ID="lblInstruccion" runat="server" Text="Para agregar o actualizar la informacion de un registro , por favor complete los datos en el formulario y a continuacion pulse sobre el boton AGREGAR O ACTUALIZAR."
                    CssClass="instruccion"></asp:Label></p>
                    <anthem:Button ID="btnEnviarMinisterio" runat="server" OnClick="btnEnviarMinisterio_Click" CssClass="button l" Text="Enviar Ministerio" PreCallBackFunction="publisch_PreCallBack" PostCallBackFunction="publisch_PostCallBack" />
                <anthem:Button ID="btnEnviarSolicitudModificacion" runat="server" OnClick="btnEnviarSolicitudModificacion_Click" CssClass="button l" Text="Enviar Solicitud Modificacion" />
                    <div class="toolbar">
                <asp:ImageButton CssClass="regresar" ID="btnRegresar" runat="server" CausesValidation="False" ImageUrl="~/Imagenes/bt-regresar.gif"
                    OnClick="btnRegresar_Click" />
                <cc1:WccAcciones ID="WccAcciones1" runat="server" AddCausesValidation="True" AddEnableCallBack="False"
                    ArchiveVisible="True" AuditVisible="False" DeclineVisible="True" DeleteEnableCallBack="False"
                    OnAdd_OnClick="WccAcciones1_Add_OnClick" OnDelete_OnClick="WccAcciones1_Delete_OnClick"
                    OnUpdate_OnClick="WccAcciones1_Update_OnClick" PublishVisible="True" UpdateCausesValidation="True"
                    UpdateEnableCallBack="True" UpdateAutoUpdateAfterCallBack="true" ValidateVisible="False"
                    AddAutoUpdateAfterCallBack="True" DeleteAutoUpdateAfterCallBack="True" OnPublish_OnClick="WccAcciones1_Publish_OnClick" OnDecline_OnClick="WccAcciones1_Decline_OnClick" OnAudit_OnClick="WccAcciones1_Audit_OnClick" ArchiveAutoupdateAfterCallBack="True" ArchiveEnableCallBack="False" OnArchive_OnClick="WccAcciones1_Archive_OnClick" />
                </div>
                <table class="tabs">
                    <tr>
                        <td class="tab-inactivo">
                            <anthem:LinkButton ID="LinkContratos" runat="server" CausesValidation="False" EnableCallBack="False"
                                 OnClick="LinkContratos_Click">Conceptos</anthem:LinkButton></td>
                    </tr>
                </table>

            
                
        <table class="forma">
        <tr>
            <td colspan="2" class="encabezado padding">
                RECURSOS ASIGNADOS<cc1:PopupPanelConsultarAuditoria ID="popupPanelConsultarAuditoria"
                    runat="server">
                </cc1:PopupPanelConsultarAuditoria>
            </td>
        </tr>
        <tr>
            <td class="campo-obligatorio"  style="width: 25%">
                Departamento</td>
            <td >
                &nbsp;<anthem:Label ID="lbldepartamento" runat="server"></anthem:Label></td>
        </tr>
        <tr>
            <td class="campo"  style="width: 25%">
                Vigencia</td>
            <td >
                <anthem:DropDownList ID="ddlvigencia" runat="server" DataSourceID="SqlDataSourceTablaVigencia"
                    DataTextField="IVI_NOMBRE" DataValueField="IVI_ID" Enabled="False">
                </anthem:DropDownList>
                <asp:SqlDataSource ID="SqlDataSourceTablaVigencia" runat="server" ConnectionString="<%$ ConnectionStrings:MCSIGConnectionString %>"
                    SelectCommand="SELECT IVI_ID, IVI_NOMBRE FROM IVA_VIGENCIA ORDER BY IVI_ID DESC">
                </asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td class="campo-obligatorio"  style="width: 25%">
                RECURSOS IVA ASIGNADOS -Proyeccion de la Distribucion</td>
            <td >
                &nbsp;<anthem:Label ID="lblRecursosIva" runat="server"></anthem:Label></td>
        </tr>
        <tr>
            <td class="campo-obligatorio"  style="width: 25%">
                TOTAL RECURSOS IVA&nbsp; ASIGNADOS-Proyectos</td>
            <td >
                <anthem:Label ID="lblRecursosAsignadosProyectosDefinitivos" runat="server" AutoUpdateAfterCallBack="True" UpdateAfterCallBack="True"></anthem:Label></td>
        </tr>
        <tr>
            <td class="campo-obligatorio"  style="width: 25%">
                Municipio</td>
            <td >
                <anthem:DropDownList ID="ddlMunicipio" runat="server" AutoUpdateAfterCallBack="True">
                </anthem:DropDownList>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="ddlMunicipio"
                    Display="Dynamic" ErrorMessage="Debe seleccionar el Municipio">*</asp:RequiredFieldValidator></td>
        </tr>
        <tr>
            <td class="campo-obligatorio"  style="width: 25%">
                Lineas</td>
            <td >
                <anthem:CheckBoxList ID="cboxLineas" runat="server" CssClass="campo" DataTextField="IVL_NOMBRE"
                    DataValueField="IVL_ID" Font-Bold="True" RepeatLayout="Flow" Width="100%" OnSelectedIndexChanged="cboxLineas_SelectedIndexChanged" AutoCallBack="True" AutoUpdateAfterCallBack="True">
                </anthem:CheckBoxList>
                <asp:SqlDataSource ID="SqlDataSourceLineasTabla" runat="server" ConnectionString="<%$ ConnectionStrings:MCSIGConnectionString %>"
                    SelectCommand="SELECT [IVL_ID], [IVL_NOMBRE] FROM [IVA_LINEAS]"></asp:SqlDataSource>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td class="campo-obligatorio"  style="width: 25%">
                Nombre del proyecto</td>
            <td >
                <asp:TextBox ID="txtNombreProyeto" runat="server" Width="879px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtNombreProyeto"
                    Display="Dynamic" ErrorMessage="Debe ingresar el nombre del proyecto">*</asp:RequiredFieldValidator>
                <asp:TextBox ID="txtIdentificador" Visible="false" runat="server" Width="879px"></asp:TextBox>
            </td>
        </tr>
        <tr id="ROESDKL" runat="server" visible = "false" >
            <td class="campo"  style="width: 25%; height: 45px;">
                Valor Total Vigencia</td>
            <td  style="height: 45px">
                <anthem:TextBox ID="txtValorTotal" runat="server" Wrap="False" ReadOnly="True">0</anthem:TextBox><br />
                &nbsp;</td>
        </tr>
        <tr>
            <td class="campo"  style="width: 25%">
                Descripcion del Proyecto</td>
            <td >
                <anthem:TextBox ID="txtDescripcionProyecto" runat="server" Height="85px" MaxLength="2000"
                    TextMode="MultiLine" Width="876px" Wrap="False"></anthem:TextBox></td>
        </tr>
        <tr>
            <td class="campo"  style="width: 25%">
                Archivos</td>
            <td >
                Los archivos Adjuntos no pueden superar las 4 Megas
                <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true">
                </asp:ScriptManager>
                <dxwgv:ASPxGridView ID="gridImagenes" runat="server" CssFilePath="~/App_Themes/Soft Orange/{0}/styles.css"
                    CssPostfix="Soft_Orange"  AutoGenerateColumns="False"
                    DataSourceID="SqlDataSource1" KeyFieldName="SIP_ID" Width="100%" OnRowDeleting="gridImagenes_RowDeleting" EnableCallBacks="False" OnRowValidating="gridImagenes_RowValidating">
                    <Images ImageFolder="~/App_Themes/Soft Orange/{0}/">
                        <CollapsedButton Height="14px" Url="~/App_Themes/Soft Orange/GridView/gvCollapsedButton.png"
                            Width="13px" />
                        <ExpandedButton Height="13px" Url="~/App_Themes/Soft Orange/GridView/gvExpandedButton.png"
                            Width="13px" />
                        <DetailCollapsedButton Height="14px" Url="~/App_Themes/Soft Orange/GridView/gvCollapsedButton.png"
                            Width="13px" />
                        <DetailExpandedButton Height="13px" Url="~/App_Themes/Soft Orange/GridView/gvExpandedButton.png"
                            Width="13px" />
                        <HeaderFilter Height="19px" Url="~/App_Themes/Soft Orange/GridView/gvHeaderFilter.png"
                            Width="19px" />
                        <HeaderActiveFilter Height="19px" Url="~/App_Themes/Soft Orange/GridView/gvHeaderFilterActive.png"
                            Width="19px" />
                        <HeaderSortDown Height="3px" Url="~/App_Themes/Soft Orange/GridView/gvHeaderSortDown.png"
                            Width="6px" />
                        <HeaderSortUp Height="3px" Url="~/App_Themes/Soft Orange/GridView/gvHeaderSortUp.png"
                            Width="6px" />
                        <PopupEditFormWindowClose Height="18px" Width="18px" />
                    </Images>
                    <Styles CssFilePath="~/App_Themes/Soft Orange/{0}/styles.css" CssPostfix="Soft_Orange">
                        <Header ImageSpacing="5px" SortingImageSpacing="5px">
                        </Header>
                        <LoadingPanel ImageSpacing="10px">
                        </LoadingPanel>
                    </Styles>
                    <Columns>
                        <dxwgv:GridViewCommandColumn VisibleIndex="0" Width="100px">
                            <EditButton Visible="True" Text="Editar">
                            </EditButton>
                            <NewButton Visible="True" Text="Nuevo">
                            </NewButton>
                            <DeleteButton Visible="True" Text="Borrar">
                            </DeleteButton>
                            <UpdateButton Text="Guardar">
                            </UpdateButton>
                        </dxwgv:GridViewCommandColumn>
                        <dxwgv:GridViewDataTextColumn FieldName="SIP_ID" ReadOnly="True" Visible="False"
                            VisibleIndex="1">
                            <EditFormSettings Visible="False" />
                        </dxwgv:GridViewDataTextColumn>
                        <dxwgv:GridViewDataTextColumn FieldName="IPI_ID" VisibleIndex="1" Visible="False">
                            <EditItemTemplate>
                                <dxe:ASPxTextBox ID="txtspz" runat="server" Width="170px" Value='<%# StrIpiId%>' />
                            </EditItemTemplate>
                            <PropertiesTextEdit EnableClientSideAPI="True">
                            </PropertiesTextEdit>
                        </dxwgv:GridViewDataTextColumn>
                        <dxwgv:GridViewDataTextColumn VisibleIndex="1" Width="200px">
                            <EditItemTemplate>
                                <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="conditional">
                                    <triggers>
                                            <asp:PostBackTrigger ControlID="UploadBtn" />
                                    </triggers>
                                    <contenttemplate>
                                               <table>
                                    <tr>
                                        <td colspan="2">
                                            <asp:FileUpload ID="FileUpload1" runat="server" Width="270px" />
                                            <asp:Button ID="UploadBtn" runat="server" Text="Subir Archivo" OnClick="UploadBtn_Click" />
                                            </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="Label1" runat="server" BackColor="#FFFF80"></asp:Label>
                                        </td>
                                        <td align="right" colspan="2">
                                            
                                        </td>
                                    </tr>
                                </table>
                                         </contenttemplate>
                                </asp:UpdatePanel>
                            </EditItemTemplate>
                        </dxwgv:GridViewDataTextColumn>
                        <dxwgv:GridViewDataTextColumn Caption="Descripci&#243;n" FieldName="SIP_DESCRIPCION" VisibleIndex="2" Width="200px">
                        </dxwgv:GridViewDataTextColumn>
                        <dxwgv:GridViewDataTextColumn Caption="Nombre" FieldName="SIP_NOMBRE" VisibleIndex="3" ReadOnly="True" Width="200px">
                            <EditItemTemplate>
                                <dxe:ASPxTextBox ID="txtNombre" runat="server" Width="170px" Value='<%# Bind("SIP_NOMBRE") %>' />
                            </EditItemTemplate>
                        </dxwgv:GridViewDataTextColumn>
                       
                    </Columns>
                    <Templates>
                        <PreviewRow>
                            <table style="border: none">
                                <tbody>
                                    <tr>
                                        <td style="width: 25%; border: none; color: Black">
                                     
                                            <a href="DocumentosRecursosIva/DocumentosPlanInversion/<%#Eval("SIP_NOMBRE")%>"><%#Eval("SIP_NOMBRE")%></a> 
                                            </td>
                                    </tr>
                                </tbody>
                            </table>
                        </PreviewRow>
                    </Templates>
                    <SettingsPager>
                        <AllButton>
                            <Image Height="19px" Width="28px" />
                        </AllButton>
                        <FirstPageButton>
                            <Image Height="19px" Width="23px" />
                        </FirstPageButton>
                        <LastPageButton>
                            <Image Height="19px" Width="23px" />
                        </LastPageButton>
                        <NextPageButton>
                            <Image Height="19px" Width="19px" />
                        </NextPageButton>
                        <PrevPageButton>
                            <Image Height="19px" Width="19px" />
                        </PrevPageButton>
                    </SettingsPager>
                    <Settings ShowFooter="True" ShowGroupFooter="VisibleIfExpanded" ShowPreview="True" />
                    <Paddings Padding="1px" />
                    <SettingsLoadingPanel Text="" />
                    <ImagesEditors>
                        <CalendarPrevYear Height="19px" Url="~/App_Themes/Soft Orange/Editors/edtCalendarPrevYear.png"
                            Width="23px" />
                        <CalendarPrevMonth Height="19px" Url="~/App_Themes/Soft Orange/Editors/edtCalendarPrevMonth.png"
                            Width="19px" />
                        <CalendarNextMonth Height="19px" Url="~/App_Themes/Soft Orange/Editors/edtCalendarNextMonth.png"
                            Width="19px" />
                        <CalendarNextYear Height="19px" Url="~/App_Themes/Soft Orange/Editors/edtCalendarNextYear.png"
                            Width="23px" />
                    </ImagesEditors>
                    <SettingsEditing Mode="Inline" />
                </dxwgv:ASPxGridView>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:MCSIGConnectionString %>"
                    DeleteCommand="DELETE FROM [SIG_IMAGENES_IVA_PLAN_INVERSION] WHERE [SIP_ID] = @SIP_ID"
                    InsertCommand="INSERT INTO [SIG_IMAGENES_IVA_PLAN_INVERSION] ([IPI_ID], [SIP_NOMBRE], [SIP_DESCRIPCION]) VALUES (@IPI_ID, @SIP_NOMBRE, @SIP_DESCRIPCION)"
                    SelectCommand="SELECT [SIP_ID], [IPI_ID], [SIP_NOMBRE], [SIP_DESCRIPCION] FROM [SIG_IMAGENES_IVA_PLAN_INVERSION] WHERE ([IPI_ID] = @IPI_ID)"
                    UpdateCommand="UPDATE [SIG_IMAGENES_IVA_PLAN_INVERSION] SET [IPI_ID] = @IPI_ID, [SIP_NOMBRE] = @SIP_NOMBRE, [SIP_DESCRIPCION] = @SIP_DESCRIPCION WHERE [SIP_ID] = @SIP_ID">
                   <SelectParameters>
                        <asp:ControlParameter ControlID="txtIdentificador" Name="IPI_ID" PropertyName="Text" Type="Decimal" />
                    </SelectParameters>
                    <DeleteParameters>
                        <asp:Parameter Name="IPI_ID" Type="Decimal" />
                    </DeleteParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="SPZ_ID" Type="Decimal" />
                        <asp:Parameter Name="SIP_NOMBRE" Type="String" />
                        <asp:Parameter Name="SIP_DESCRIPCION" Type="String" />
                        <asp:Parameter Name="IPI_ID" Type="Decimal" />
                    </UpdateParameters>
                    <InsertParameters>
                        <asp:ControlParameter ControlID="txtIdentificador" Name="IPI_ID" PropertyName="Text"
                            Type="Decimal" />
                        <asp:Parameter Name="SIP_NOMBRE" Type="String" />
                        <asp:Parameter Name="SIP_DESCRIPCION" Type="String" />
                    </InsertParameters>
                </asp:SqlDataSource>
                </td>
        </tr>
        <tr>
            <td class="campo"  style="width: 25%; height: 100%;">
                Financiacion</td>
            <td >
                
                    <asp:SqlDataSource ID="SqlDataSourceVigencia" runat="server" ConnectionString="<%$ ConnectionStrings:MCSIGConnectionString %>"
                        SelectCommand="SELECT IVI_ID,IVI_NOMBRE FROM IVA_VIGENCIA ORDER BY 1 DESC">
                        </asp:SqlDataSource>
                    <asp:SqlDataSource ID="SqlDataSourceRecursosIvaVigencias" runat="server" ConnectionString="<%$ ConnectionStrings:MCSIGConnectionString %>"
                        SelectCommand="SELECT IVA_PLAN_INVERSION_IVA_VIGENCIA.IIV_ID, IVA_VIGENCIA.IVI_ID, IVA_VIGENCIA.IVI_NOMBRE, IVA_PLAN_INVERSION_IVA_VIGENCIA.IIV_VALOR, IVA_PLAN_INVERSION_IVA_VIGENCIA.IPI_ID FROM IVA_VIGENCIA INNER JOIN IVA_PLAN_INVERSION_IVA_VIGENCIA ON IVA_VIGENCIA.IVI_ID = IVA_PLAN_INVERSION_IVA_VIGENCIA.IVI_ID WHERE IVA_PLAN_INVERSION_IVA_VIGENCIA.IPI_ID = @IPI_ID"
                        DeleteCommand="DELETE FROM [IVA_PLAN_INVERSION_IVA_VIGENCIA] WHERE [IIV_ID] = @IIV_ID"
                        InsertCommand="INSERT INTO [IVA_PLAN_INVERSION_IVA_VIGENCIA] ([IVI_ID], [IIV_VALOR],[IPI_ID]) VALUES (@IVI_ID, @IIV_VALOR, @IPI_ID)"
                        UpdateCommand="UPDATE [IVA_PLAN_INVERSION_IVA_VIGENCIA] SET [IIV_VALOR] = @IIV_VALOR, [IVI_ID] = @IVI_ID WHERE [IIV_ID] = @IIV_ID">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="txtIdentificador" Name="IPI_ID" PropertyName="Text"
                                Type="Decimal" />
                        </SelectParameters>
                        <DeleteParameters>
                            <asp:Parameter Name="IIV_ID" Type="Decimal" />
                        </DeleteParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="IVI_ID" Type="Decimal" />
                            <asp:Parameter Name="IIV_VALOR" Type="String" />
                            <asp:Parameter Name="IIV_ID" Type="Decimal" />
                        </UpdateParameters>
                        <InsertParameters>
                            <asp:ControlParameter ControlID="txtIdentificador" Name="IPI_ID" PropertyName="Text"
                                Type="Decimal" />
                            <asp:Parameter Name="IVI_ID" Type="Decimal" />
                            <asp:Parameter Name="IIV_VALOR" Type="Decimal" />
                        </InsertParameters>
                    </asp:SqlDataSource>
                    <table border="0" cellpadding="0" cellspacing="0" width="100%">
                        <tr id= "trMensajeGrid" runat="server">
                            <td style="color: #ff3366; font-family: Arial">
                                <strong><span style="color: #0000ff"></span></strong></td>
                            <td valign="middle">
                            </td>
                        </tr>
                        <tr>
                            <td style="color: #ff3366; font-family: Arial; height: 19px;">
                                <strong><span style="color: #3300ff"></span></strong></td>
                            <td valign="middle" style="height: 19px">
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                    <tr>
                                        <td style="width: 70%;">
                                            <dxwgv:ASPxGridView ID="gridRecursosIvaVigencia" runat="server" KeyFieldName="IIV_ID"
                                                Width="100%" AutoGenerateColumns="False" DataSourceID="SqlDataSourceRecursosIvaVigencias"
                                                OnHtmlRowPrepared="gridRecursosIvaVigencia_HtmlRowPrepared" OnRowValidating="gridRecursosIvaVigencia_RowValidating" EnableCallBacks="False">
                                                <SettingsPager>
                                                    <AllButton Text="Todos" Visible="True">
                                                    </AllButton>
                                                </SettingsPager>
                                                <Columns>
                                                    <dxwgv:GridViewCommandColumn Caption="Operaci&#243;n" VisibleIndex="0" Width="160px">
                                                        <EditButton Text="Editar" Visible="True">
                                                            <Image Url="~/images/editar.png">
                                                            </Image>
                                                        </EditButton>
                                                        <NewButton Text="Nuevo" Visible="True">
                                                            <Image Url="~/images/nuevo.png">
                                                            </Image>
                                                        </NewButton>
                                                        <DeleteButton Text="Borrar" Visible="True">
                                                            <Image Url="~/images/borrar.png">
                                                            </Image>
                                                        </DeleteButton>
                                                        <CancelButton Text="Cancelar">
                                                            <Image Url="~/images/cancelar.png">
                                                            </Image>
                                                        </CancelButton>
                                                        <UpdateButton Text="Guardar">
                                                            <Image Url="~/images/salvar.png">
                                                            </Image>
                                                        </UpdateButton>
                                                    </dxwgv:GridViewCommandColumn>
                                                    <dxwgv:GridViewDataTextColumn FieldName="IIV_ID" Visible="False" VisibleIndex="1">
                                                    </dxwgv:GridViewDataTextColumn>
                                                    <dxwgv:GridViewDataComboBoxColumn Caption="Vigencia" FieldName="IVI_ID" VisibleIndex="1"
                                                        Width="100px">
                                                        <PropertiesComboBox DataSourceID="SqlDataSourceVigencia" TextField="IVI_NOMBRE" ValueField="IVI_ID"
                                                            ValueType="System.String">
                                                        </PropertiesComboBox>
                                                    </dxwgv:GridViewDataComboBoxColumn>
                                                    <dxwgv:GridViewDataTextColumn Caption="Valor" FieldName="IIV_VALOR" VisibleIndex="2"
                                                        Width="200px">
                                                        <PropertiesTextEdit DisplayFormatString="{0:N0}">
                                                        </PropertiesTextEdit>
                                                    </dxwgv:GridViewDataTextColumn>
                                                    <dxwgv:GridViewDataTextColumn FieldName="IPI_ID" Visible="False" VisibleIndex="1">
                                                        <EditFormSettings Visible="False" />
                                                    </dxwgv:GridViewDataTextColumn>
                                                </Columns>
                                                <TotalSummary>
                                                    <dxwgv:ASPxSummaryItem DisplayFormat="${0:N0}" FieldName="IIV_VALOR" ShowInColumn="IIV_VALOR"
                                                        SummaryType="Sum" />
                                                </TotalSummary>
                                                <Settings ShowFooter="True" ShowTitlePanel="True" />
                                                <ClientSideEvents EndCallback="function(s, e) {actualizarTotales();}" />
                                                <SettingsText Title="Recursos Iva Vigencias " />
                                            </dxwgv:ASPxGridView>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 70%">
                                            <dxwgv:ASPxGridView ID="ASPxGridViewOtrasFuentes" runat="server" KeyFieldName="IPF_ID"
                                                Width="100%" AutoGenerateColumns="False" DataSourceID="SqlDataSourceFuentesFinanciacion"
                                                OnHtmlRowPrepared="ASPxGridViewOtrasFuentes_HtmlRowPrepared">
                                                <SettingsPager>
                                                    <AllButton Text="Todos" Visible="True">
                                                    </AllButton>
                                                </SettingsPager>
                                                <SettingsEditing Mode="EditForm" />
                                                <Columns>
                                                    <dxwgv:GridViewCommandColumn VisibleIndex="0" Caption="Operaci&#243;n" Width="160px">
                                                        <EditButton Visible="True" Text="Editar">
                                                        </EditButton>
                                                        <NewButton Visible="True" Text="Nuevo">
                                                        </NewButton>
                                                        <DeleteButton Visible="True" Text="Borrar">
                                                        </DeleteButton>
                                                        <CancelButton Text="Cancelar">
                                                        </CancelButton>
                                                        <UpdateButton Text="Guardar">
                                                        </UpdateButton>
                                                    </dxwgv:GridViewCommandColumn>
                                                    <dxwgv:GridViewDataTextColumn FieldName="IPF_ID" VisibleIndex="1" Visible="False">
                                                    </dxwgv:GridViewDataTextColumn>
                                                    <dxwgv:GridViewDataTextColumn FieldName="IFF_ID" VisibleIndex="1" Visible="False">
                                                    </dxwgv:GridViewDataTextColumn>
                                                    <dxwgv:GridViewDataTextColumn FieldName="IPI_ID" VisibleIndex="1" Visible="False">
                                                        <EditFormSettings Visible="False" />
                                                    </dxwgv:GridViewDataTextColumn>
                                                    <dxwgv:GridViewDataComboBoxColumn FieldName="IFF_ID" Caption="Fuentes" VisibleIndex="1"
                                                        Width="100px">
                                                        <PropertiesComboBox TextField="IFF_NOMBRE" ValueField="IFF_ID" DataSourceID="SqlDataSourceFuentes"
                                                            ValueType="System.String">
                                                        </PropertiesComboBox>
                                                    </dxwgv:GridViewDataComboBoxColumn>
                                                    <dxwgv:GridViewDataTextColumn Caption="Valor" FieldName="IIF_VALOR" VisibleIndex="2"
                                                        Width="200px">
                                                        <PropertiesTextEdit DisplayFormatString="{0:N0}">
                                                        </PropertiesTextEdit>
                                                    </dxwgv:GridViewDataTextColumn>
                                                </Columns>
                                                <TotalSummary>
                                                    <dxwgv:ASPxSummaryItem DisplayFormat="${0:N0}" FieldName="IIF_VALOR" ShowInColumn="IIF_VALOR"
                                                        SummaryType="Sum" />
                                                </TotalSummary>
                                                <Settings ShowFooter="True" ShowTitlePanel="True" />
                                                <ClientSideEvents EndCallback="function(s, e) {actualizarTotales();}" />
                                                <SettingsText Title="Otras Fuentes" />
                                            </dxwgv:ASPxGridView>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td valign="middle">
                                &nbsp;<table border="1" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td>
                                            <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                                <tr>
                                                    <td class="campo">
                                                        Valor Tota Iva</td>
                                                    <td>
                                                        <anthem:Label ID="lblTotalVigencia" runat="server" AutoUpdateAfterCallBack="True"
                                                            UpdateAfterCallBack="True"></anthem:Label></td>
                                                </tr>
                                                <tr>
                                                    <td class="campo">
                                                        Valor Total Otras Fuentes</td>
                                                    <td>
                                                        &nbsp;<anthem:Label ID="lblTotalOtrasFuentes" runat="server" AutoUpdateAfterCallBack="True"
                                                            UpdateAfterCallBack="True"></anthem:Label></td>
                                                </tr>
                                                <tr>
                                                    <td style="text-align: center">
                                                        Valor Total</td>
                                                    <td>
                                                        <anthem:Label ID="lblTotal" runat="server" AutoUpdateAfterCallBack="True" UpdateAfterCallBack="True"></anthem:Label></td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                    <asp:SqlDataSource ID="SqlDataSourceFuentes" runat="server" ConnectionString="<%$ ConnectionStrings:MCSIGConnectionString %>"
                        SelectCommand="SELECT IFF_ID, IFF_NOMBRE FROM IVA_FUENTES_FINANCIACION ORDER BY 2">
                        <FilterParameters>
                            <asp:Parameter Name="USU_ID" />
                        </FilterParameters>
                    </asp:SqlDataSource>
                    <asp:SqlDataSource ID="SqlDataSourceFuentesFinanciacion" runat="server" ConnectionString="<%$ ConnectionStrings:MCSIGConnectionString %>"
                        SelectCommand="SELECT
                                    IVA_PLAN_INVERSION_IVA_FUENTES_FINANCIACION.IPI_ID, 
                                    IVA_PLAN_INVERSION_IVA_FUENTES_FINANCIACION.IFF_ID, 
                                    IVA_PLAN_INVERSION_IVA_FUENTES_FINANCIACION.IIF_VALOR, 
                                    IVA_FUENTES_FINANCIACION.IFF_NOMBRE, 
                                    IVA_PLAN_INVERSION_IVA_FUENTES_FINANCIACION.IPF_ID
                                    FROM         IVA_PLAN_INVERSION INNER JOIN
                                                          IVA_PLAN_INVERSION_IVA_FUENTES_FINANCIACION ON 
                                                          IVA_PLAN_INVERSION.IPI_ID = IVA_PLAN_INVERSION_IVA_FUENTES_FINANCIACION.IPI_ID INNER JOIN
                                                          IVA_FUENTES_FINANCIACION ON IVA_PLAN_INVERSION_IVA_FUENTES_FINANCIACION.IFF_ID = IVA_FUENTES_FINANCIACION.IFF_ID
                                                        WHERE
                                    IVA_PLAN_INVERSION_IVA_FUENTES_FINANCIACION.IPI_ID = @IPI_ID" DeleteCommand="DELETE FROM [IVA_PLAN_INVERSION_IVA_FUENTES_FINANCIACION] WHERE [IPF_ID] = @IPF_ID"
                        InsertCommand="INSERT INTO [IVA_PLAN_INVERSION_IVA_FUENTES_FINANCIACION] ([IFF_ID], [IIF_VALOR],[IPI_ID]) VALUES (@IFF_ID, @IIF_VALOR, @IPI_ID)"
                        UpdateCommand="UPDATE [IVA_PLAN_INVERSION_IVA_FUENTES_FINANCIACION] SET [IIF_VALOR] = @IIF_VALOR, [IFF_ID] = @IFF_ID WHERE [IPF_ID] = @IPF_ID">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="txtIdentificador" Name="IPI_ID" PropertyName="Text"
                                Type="Decimal" />
                        </SelectParameters>
                        <DeleteParameters>
                            <asp:Parameter Name="IPF_ID" Type="Decimal" />
                        </DeleteParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="IFF_ID" Type="Decimal" />
                            <asp:Parameter Name="IIF_VALOR" Type="String" />
                            <asp:Parameter Name="IPF_ID" Type="Decimal" />
                        </UpdateParameters>
                        <InsertParameters>
                            <asp:ControlParameter ControlID="txtIdentificador" Name="IPI_ID" PropertyName="Text"
                                Type="Decimal" />
                            <asp:Parameter Name="IFF_ID" Type="Decimal" />
                            <asp:Parameter Name="IIF_VALOR" Type="Decimal" />
                        </InsertParameters>
                    </asp:SqlDataSource>
                <cc1:PopupPanel ID="PopupPanelMotivoRechazo" runat="server" Height="267px" 
                    Width="599px">
                    <table id="Table1" align="center" border="0" cellpadding="1" cellspacing="1" height="23"
                        width="359">
                        <tr>
                            <td>
                                <asp:ValidationSummary ID="ValidationSummary2" runat="server" CssClass="notification note-error" ValidationGroup="grupoObRe" />
                            </td>
                        </tr>
                    </table>
                    <table id="Table2" align="center" border="0" cellpadding="1" cellspacing="1" width="550">
                        <tr>
                            <td>
                                &nbsp;<anthem:Label ID="lblMensajeRechado" runat="server" AutoUpdateAfterCallBack="True"
                                    CssClass="notification note-error" UpdateAfterCallBack="True" Visible="False" Width="100%"></anthem:Label></td>
                        </tr>
                    </table>
                    <table id="Table3" align="center" border="0" cellpadding="1" cellspacing="1" class="borde"
                        width="80%">
                        <tr>
                            <td class="toolbar" colspan="3">
                                &nbsp;Por favor ingrese el motivo por el cual se rechaza este Proyecto</td>
                        </tr>
                        <tr>
                            <td colspan="2">
                            </td>
                            <td class="fila1">
                                <anthem:ImageButton ID="imgRechazo" runat="server" AutoUpdateAfterCallBack="True"
                                    CausesValidation="False" ImageUrl="Imagenes/fancy_close.png" OnClick="imgRechazo_Click1" /></td>
                        </tr>
                        <tr>
                            <td class="campo">
                                Motivo Rechazo:
                            </td>
                            <td style="width: 4px">
                                <asp:TextBox ID="txtObservacionesRechazo" runat="server" CssClass="box" Height="84px"
                                    MaxLength="1000" ToolTip="Correo electronico" Width="332px" TextMode="MultiLine"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator17" runat="server" ControlToValidate="txtObservacionesRechazo"
                                    Display="Dynamic" ErrorMessage="Debe Ingresar el campo Motivo Rechazo" ValidationGroup="grupoObRe">*</asp:RequiredFieldValidator></td>
                            <td class="fila1">
                                &nbsp;&nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td align="center" colspan="3">
                                <asp:ImageButton ID="btnIngresarMotivoRechazo" runat="server" ImageUrl="Images/bt-ingresar.gif"
                                    OnClick="btnIngresarMotivoRechazo_Click" ValidationGroup="grupoObRe" /></td>
                        </tr>
                    </table>
                
                </cc1:PopupPanel>
                <cc1:PopupPanel ID="pnlSolicitudModificacion" runat="server" Height="267px"
                    Width="599px">
                    <table id="Table5" align="center" border="0" cellpadding="1" cellspacing="1" height="23"
                        width="359">
                        <tr>
                            <td>
                                <asp:ValidationSummary ID="ValidationSummary3" runat="server" CssClass="notification note-error" ValidationGroup="grupoSoMo" />
                            </td>
                        </tr>
                    </table>
                    <table id="Table6" align="center" border="0" cellpadding="1" cellspacing="1" width="550">
                        <tr>
                            <td>
                                &nbsp;<anthem:Label ID="lblMensajeSolicitudModificacion" runat="server" AutoUpdateAfterCallBack="True"
                                    CssClass="notification note-error" UpdateAfterCallBack="True" Visible="False" Width="100%"></anthem:Label></td>
                        </tr>
                    </table>
                    <table id="Table7" align="center" border="0" cellpadding="1" cellspacing="1" class="borde"
                        width="80%">
                        <tr>
                            <td class="toolbar" colspan="3">
                                &nbsp;Por favor ingrese la solicitud de modificacion de este Proyecto</td>
                        </tr>
                        <tr>
                            <td colspan="2">
                            </td>
                            <td class="fila1">
                                <anthem:ImageButton ID="ImageButton1" runat="server" AutoUpdateAfterCallBack="True"
                                    CausesValidation="False" ImageUrl="Imagenes/fancy_close.png" OnClick="ImageButton1_Click" /></td>
                        </tr>
                        <tr>
                            <td class="campo">
                                Solicitud Modificacion:
                            </td>
                            <td style="width: 4px">
                                <asp:TextBox ID="txtSolicitudModificacion" runat="server" CssClass="box" Height="24px"
                                    MaxLength="1000" ToolTip="Correo electronico" Width="329px"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtSolicitudModificacion"
                                    Display="Dynamic" ErrorMessage="Debe Ingresar el campo Motivo Rechazo" ValidationGroup="grupoSoMo">*</asp:RequiredFieldValidator></td>
                            <td class="fila1">
                                &nbsp;&nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td align="center" colspan="3" style="height: 21px">
                                <asp:ImageButton ID="btnSolicitudModificacion" runat="server" ImageUrl="Images/bt-ingresar.gif"
                                    OnClick="btnSolicitudModificacion_Click" ValidationGroup="grupoSoMo" /></td>
                        </tr>
                    </table>

                </cc1:PopupPanel>
                
            </td>
        </tr>
    </table>
</asp:Content>
